package com.hnas.hnt.service;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.hnas.hnt.dao.IndustryDAO;
import com.hnas.hnt.orm.Industry;


@Component("industryService")
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
public class IndustryService implements IIndustryService {
	/**
	 * 
	 */
	@Autowired
	private IndustryDAO industryDAO;
	

	public List<Industry> getIndustrys(){
		return this.industryDAO.getIndustrys();
	}
	public String getIndustryNameByid(String id){
		Industry vo= this.industryDAO.find(id);
		String industryName="";
		if(null!=vo){
			industryName=vo.getINDUSTRY_NAME();
		}
		return industryName;
	}
	@Override
	public List<Industry> getAllIndustry() {
		return this.industryDAO.getAllIndustry();
	}
}
